﻿import ko = require("knockout");
import Project = require("Project");

class Cursor {
    protected zoom: KnockoutObservable<number>;
    protected position: KnockoutObservable<number>;
    protected playbackPosition: KnockoutObservable<number>;

    public constructor(params: ICursorParams) {
        this.zoom = params.zoom;
        this.position = params.position;
        this.playbackPosition = params.playbackPosition;
    }

    public offset: KnockoutComputed<string> = ko.pureComputed(() => {
        return this.zoom() * this.position() + "px";
    });

    public playbackOffset: KnockoutComputed<string> = ko.pureComputed(() => {
        return this.zoom() * 10000 * this.playbackPosition() + "px";
    });

}

export = Cursor;